package com.kmproject.haifu.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kmproject.haifu.R;
import com.kmproject.haifu.mvp.model.entity.beans.HousePayWayBean;

import java.util.List;

public class PopuWindowSelectZjAdapter extends BaseQuickAdapter<HousePayWayBean, BaseViewHolder> {
    public PopuWindowSelectZjAdapter( @Nullable List<HousePayWayBean> data) {
        super(R.layout.popuwindowselectzj_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HousePayWayBean item) {
        if (helper.getPosition()==0)
        {
            helper.<TextView>getView(R.id.popuwindowselectzj_item_txt).setText(item.getName());
        }else {
            if ("0".equals(item.getCategory()))
            {
                helper.<TextView>getView(R.id.popuwindowselectzj_item_txt).setText("<="+item.getCode());
            }else {
                helper.<TextView>getView(R.id.popuwindowselectzj_item_txt).setText(item.getCategory()+"-"+item.getCode());
            }

        }

    }
}
